import http from "@/utils/request";

// 获取排班模板分页列表
export const getScheduleList = (data) => {
    return http.get("/rsgl/schedule/list", { params: data });
};

// 获取排班模板详情
export const getScheduleById = (scheduleId) => {
    return http.get(`/rsgl/schedule/get/${scheduleId}`);
};

// 新增排班模板
export const addSchedule = (data) => {
    return http.post("/rsgl/schedule/add", data);
};

// 修改排班模板
export const updateSchedule = (data) => {
    return http.put("/rsgl/schedule/update", data);
};

// 删除排班模板
export const deleteScheduleById = (scheduleId) => {
    return http.delete(`/rsgl/schedule/delete/${scheduleId}`);
};

// 获取排班详情分页列表
export const getScheduleDetailsList = (data) => {
    return http.get("/rsgl/schedule/details/list", { params: data });
};

// 获取用户排班详情
export const getUserSchedule = (data) => {
    return http.get(`/rsgl/schedule/user/${data.userId}`, { params: { date: data.date } });
};

// 新增排班详情
export const addScheduleDetail = (data) => {
    return http.post("/rsgl/schedule/details/add", data);
};

// 修改排班详情
export const updateScheduleDetail = (data) => {
    return http.put("/rsgl/schedule/details/update", data);
};

// 删除排班详情
export const deleteScheduleDetailById = (detailId) => {
    return http.delete(`/rsgl/schedule/details/delete/${detailId}`);
};